/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.order.entity;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.springframework.context.annotation.Lazy;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wealth.member.entity.Member;
import com.wealth.system.entity.Corporation;

/**
 * 银行订单
 * create  by xingfan 
 * modify by chan on 2016-09-18 添加优惠券字段
 */
@Entity
@Table(name = "t_order_plat")
public class OrderPlat implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private String orderno;
	private Integer paymentType;
	private Integer paymode;
	private Double actualPrice;		//实际总金额
	private Double subPrice;			//减免金额
	private Double total;				//实际支付金额
	private Integer score;              //支付积分
	private Integer status;
	private Integer paystatus;  
	private Date createTime;
	private Date payTime;
	private Corporation corp;			//银行
	private Member member;		//会员
	private String remarks;//备注
	private List<Order> orderList = new ArrayList<Order>();
	
	/* ---------------- method ----------------*/
	
	public OrderPlat(){
	}

	public OrderPlat(Long id){
		this.id = id;
	}

	/* ---------------- getter/setter ----------------*/
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "orderno")
	public String getOrderno() {
		return orderno;
	}
	
	public void setOrderno(String orderno) {
		this.orderno = orderno;
	}
	
	@Column(name = "payment_type")
	public Integer getPaymentType() {
		return paymentType;
	}
	
	public void setPaymentType(Integer paymentType) {
		this.paymentType = paymentType;
	}
	
	@Column(name = "paymode")
	public Integer getPaymode() {
		return paymode;
	}
	
	public void setPaymode(Integer paymode) {
		this.paymode = paymode;
	}
	
	@Column(name = "actual_price")
	public Double getActualPrice() {
		return actualPrice;
	}
	
	public void setActualPrice(Double actualPrice) {
		this.actualPrice = actualPrice;
	}
	
	@Column(name = "sub_price")
	public Double getSubPrice() {
		return subPrice;
	}
	
	public void setSubPrice(Double subPrice) {
		this.subPrice = subPrice;
	}
	
	@Column(name = "total")
	public Double getTotal() {
		return total;
	}
	
	public void setTotal(Double total) {
		this.total = total;
	}
	
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getPaystatus() {
		return paystatus;
	}

	public void setPaystatus(Integer paystatus) {
		this.paystatus = paystatus;
	}

	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	@Column(name = "pay_time")
	public Date getPayTime() {
		return payTime;
	}

	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}

	@ManyToOne
	@JoinColumn(name="corp_id")
	public Corporation getCorp() {
		return corp;
	}

	public void setCorp(Corporation corp) {
		this.corp = corp;
	}

	@ManyToOne
	@JoinColumn(name="member_id")
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}
	
	@OneToMany(mappedBy="orderPlat")
	@JsonIgnore
	public List<Order> getOrderList() {
		return orderList;
	}

	public void setOrderList(List<Order> orderList) {
		this.orderList = orderList;
	}

	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	 
}



